package com.blog.service;

import com.blog.mapper.OrdersMapper;
import com.blog.seckill.goods.ProductSku;
import com.blog.seckill.orders.Orders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName OrdersBaseService
 * @Destription  Orders基础：增删改查
 * @Author 天堂小野花
 * @Date 2025/8/19  18:35
 * @Version 1.0
 */
@Service
public class OrdersBaseService {
    @Autowired
    OrdersMapper ordersMapper;
    //表 Orders
    public Orders selectOrdersById(Long id){
        return ordersMapper.selectByPrimaryKey(id);
    }
    public int insertOrders(Orders orders){
        return ordersMapper.insert(orders);
    }
    public int updateOrders(Orders orders){
        return ordersMapper.updateByPrimaryKeySelective(orders);
    }
    public int deleteOrdersById(Long id){
        return ordersMapper.deleteByPrimaryKey(id);
    }

    public List<Orders> selectAllOrders() {
        return ordersMapper.selectAllOrders();
    }
}
